<extend name="Public/base"/>

<block name="body">
  <div class="main-title">
    <h2>
      {$info['id']?'编辑':'新增'}导航
      <notempty name="pid">
        [&nbsp;父导航：<a href="{:U('index','pid='.$pid)}">{$parent.title}</a>&nbsp;]
      </notempty>
    </h2>
  </div>
  <form action="{:U()}" method="post" class="form-horizontal">
    <input type="hidden" name="pid" value="{$pid}">
    <div class="form-item">
      <label class="item-label">导航位置<span class="check-tips">（用于设置导航在前端的显示位置）</span></label>
      <div class="controls">
        <select name="position">
          <volist name="Think.config.CHANNEL_POSITION" id="position">
            <option value="{$key}" <eq name="key" value="$info['position']">selected="selected"</eq>>{$position}</option>
          </volist>
        </select>
      </div>
    </div>    
    <div class="form-item">
      <label class="item-label">导航标题<span class="check-tips">（用于显示的文字）</span></label>
      <div class="controls">
        <input type="text" class="text input-large" name="title" value="{$info.title|default=''}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">导航链接<span class="check-tips">（用于调转的URL，支持带http://的了解或U函数如：Item/Index/3）</span></label>
      <div class="controls">
        <input type="text" class="text input-large" name="url" value="{$info.url|default=''}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">导航简述<span class="check-tips">（导航简短概述）</span></label>
      <div class="controls">
        <input type="text" class="text input-large" name="brief" value="{$info.brief|default=''}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">分类图标</label>
      <div class="controls">
        {:hook('uploadImages', array('fileid' => 'upload_picture', 'name' => 'icon', 'value' => array($info['icon']), 'tpl' => 'baidu/img'))}
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">新窗口打开<span class="check-tips">（是否新窗口打开链接）</span></label>
      <div class="controls">
        <label class="radio"><input type="radio" value="1" name="target">是</label>
        <label class="radio"><input type="radio" value="0" name="target">否</label>
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">优先级<span class="check-tips">（导航显示顺序）</span></label>
      <div class="controls">
        <input type="text" class="text input-small" name="sort" value="{$info.sort|default='0'}">
      </div>
    </div>
        <div class="form-item">
            <label class="item-label">是否显示<span class="check-tips">（是否在前台显示该导航）</span></label>
            <div class="controls">
        <label class="radio"><input type="radio" value="1" name="status">是</label>
        <label class="radio"><input type="radio" value="0" name="status">否</label>
            </div>
        </div>
    <div class="form-item">
      <input type="hidden" name="id" value="{$info.id|default=''}">
      <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
      <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
    </div>
  </form>
</block>

<block name="script">
  <script type="text/javascript" charset="utf-8">
    //设置单选，复选，下拉菜单的值
    Core.setValue('position','{$info.position|default=1}');
    Core.setValue('target','{$info.target|default=0}');
    Core.setValue('status','{$info.status|default=1}');

    //导航高亮
    highlight_subnav("{:U('index')}");
  </script>
</block>
